home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / T / THINK Power 1.0ß1 / Extensions Src / THINK Power Extensions.h < prev    next >
Encoding:
Text File  |  1993-09-10  |  2.3 KB  |  66 lines  |  [TEXT/R*ch]

  1. // THINK Power Extensions.h - Written by Stefan Arentz, August 1993
  2.  
  3. #pragma once
  4.  
  5. // ———————————————— constants...
  6.  
  7. #define kTPExentsionType        'TpXt'
  8.  
  9.  
  10. // ———————————————— structures...
  11.  
  12. typedef struct {
  13.     // CallbackBlock version...
  14.     short                version;
  15.  
  16.     // Version 1 callbacks...
  17.     pascal Handle        (*GetWindowContents)(WindowPtr theWindow);
  18.     pascal void            (*GetSelection)(long *selStart, long *selEnd, long *firstChar);
  19.     pascal void            (*SetSelection)(long selStart, long selEnd, long firstChar);
  20.     pascal void            (*GetDocInfo)(WindowPtr theWindow, Str255 fileName, short *vRefNum, long *dirID);
  21.     pascal long            (*GetModDate)(WindowPtr theWindow);
  22.     pascal Handle        (*Copy)(void);
  23.     pascal Handle        (*Paste)(Handle theText);
  24.  
  25.     // Version 2 callbacks...
  26.  
  27.     /*    Text-Editing stuff */
  28.     pascal    long        (*GetLastLine)(void);
  29.     pascal    long        (*GetLineNumber)(long selection);
  30.     pascal    long        (*GetLineStart)(long selection);
  31.     pascal    long        (*GetLineEnd)(long selection);
  32.     pascal    long        (*GetLinePos)(long line);
  33.     
  34.     pascal    void        (*Insert)(char *text, long len);
  35.     pascal    void        (*Delete)(void);
  36.     
  37.     /*    Getting and Setting window text */
  38.     pascal    void        (*SetWindowContents)(WindowPtr w, Handle h);
  39.     pascal    void        (*ContentsChanged)(WindowPtr w);
  40.     
  41.     /*    Reading file text */
  42.     pascal    Handle        (*GetFileText)(short vRefNum, long dirID, Str255 fName, Boolean *canDispose);
  43.  
  44.     /*    Direct user-interface calls */
  45.     pascal    Boolean        (*GetFolder)(Str255 prompt, short *vRefNum, long *dirID);
  46.     pascal    Boolean        (*OpenSeveral)(Boolean sort, short *file_count, StandardFileReply ***files);
  47.     
  48.     pascal    DialogPtr    (*CenterDialog)(short dialogID);
  49.     pascal    Boolean        (*StandardFilter)(DialogPtr d, EventRecord *event, short *item);
  50.     pascal    void        (*FrameDialogItem)(DialogPtr d, short item);
  51.     
  52.     pascal    WindowPtr    (*NewDocument)(void);
  53.     pascal    WindowPtr    (*OpenDocument)(void);
  54.  
  55.     /*    Utility Routines */
  56.     pascal    Handle        (*Allocate)(long size, Boolean clear);
  57.     pascal    long        (*FindPattern)(char *text, long text_len, long text_offset,  char *pat, long pat_len, Boolean case_sensitive);
  58.     
  59.     pascal    void        (*ReportOSError)(short code);
  60.     
  61.     /*    Preference routines */
  62.     pascal    void        (*GetPreference)(ResType prefType, short req_len, void *buffer, short *act_len);
  63.     pascal    void        (*SetPreference)(ResType prefType, short req_len, void *buffer, short *act_len);
  64.  
  65. } ExternalCallbackBlock;
  66.